module oled_chinese
(   
input wire clk,
input wire rst, 
input wire [3:0]	oled_mode,key2_mode7,                                                             
output reg oled_csn,oled_rst,oled_dcn,oled_clk,oled_dat,
input [7:0] curr_hour1,curr_hour0,curr_min1,curr_min0,curr_sec1,curr_sec0,
input [7:0] next_hour1,next_hour0,next_min1,next_min0,next_sec1,next_sec0,
input [7:0] diff_hour1,diff_hour0,diff_min1,diff_min0,diff_sec1,diff_sec0
);
                                         
                                          

localparam INIT_DEPTH  = 16'd25; //LCD闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋涢ˇ鐢稿极瀹ュ绀嬫い鎺嶇劍椤斿洦绻濆閿嬫緲閳ь剚娲熷畷顖烆敍濮樿鲸娈鹃梺鍝勮閸庢煡鎮￠弴鐘亾閸忓浜鹃梺閫炲苯澧寸€规洘娲熼獮瀣偐閻㈡妲搁梻浣告惈缁嬩線宕㈡禒瀣亗婵炲棙鎸婚悡鐔镐繆閵堝倸浜鹃梺缁橆殔閿曪箑鈻庨姀銈嗗殤妞ゆ帒鍊婚敍婊堟⒑闁偛鑻晶顕€鏌ｉ敐鍡欑疄鐎规洜鍠栭、妤呭磼濮橆剛顔囬梻浣筋嚙妤犲摜绮诲澶婄？閺夊牜鐓堝▓浠嬫煕濞戞﹫鍔熸い鈺佸级缁绘繈妫冨☉鍗炲壉闂佺粯鎸鹃崰鏍蓟閵娿儮鏀介柛鈾€鏅滃暩闂備浇顫夐悡锛勭不閺嶎厼钃熼柨娑樺濞岊亪鏌涢幘妞诲亾婵℃彃鐗撳铏光偓鍦У椤ュ銇勯敂璇茬仸闁糕斂鍨洪幆鏃堝Χ閸モ晜婢戦梻浣告惈濞诧箓鎳濇ィ鍐ㄥ嚑闁割偁鍎查埛鎺楁煕鐏炲墽鎳嗛柛蹇撴湰閵囧嫰濮€閻欏懎濮涚紓浣介哺閻燂妇鈧潧銈稿鍫曞箣閻欏懐涓插┑鐘垫暩婵炩偓婵炰匠鍥舵晞闁告侗鍨虫稉宥嗘叏濡灝鐓愰柣鎾存礋閺岀喐瀵肩€涙ɑ閿梺鍝勵儐缁嬫挾妲愰幒妤€鐒垫い鎺戝€甸崑鎾绘晲鎼粹€茬按婵炲瓨绮嶇划鎾诲蓟閻旂厧浼犻柛鏇ㄥ帨閵堝鐓曢柡鍌濇硶鏍￠梺闈涙搐鐎氭澘顕ｉ鍌涘磯闁靛﹥鍓崟顒€寮挎繝鐢靛Т鐎氼喚鏁☉銏＄厵鐎瑰嫮澧楅崳鐣岀磼椤旂偓鏆╅柍褜鍓ㄧ紞鍡樼濠靛鍋柛宀€鍋為埛鎺懨归敐鍥у妺闁搞倐鍋撻梻浣规偠閸婃牠鎮ч悩鑽ゅ祦闊洦绋掗弲鎼佹煥閻曞倹瀚�
localparam IDLE        = 6'h1,
           MAIN        = 6'h2,
           INIT        = 6'h3, 
           SCAN        = 6'h4,
           WRITE       = 6'h5, 
           DELAY       = 6'h6,
		   CHINESE 	   = 6'h7,
		   CHINESE_FAN = 6'h8;
localparam HIGH        = 1'b1,
           LOW         = 1'b0;
localparam DATA        = 1'b1,
           CMD         = 1'b0;
localparam time_long   = 5 ;
localparam temp_long   = 12;

reg  [7:0]  cmd[24:0]  ;
reg  [39:0] mem[123:0] ;
reg [127:0] choice [7:0];
reg [63:0] mem_chinese [142:0];
reg  [7:0]	y_p        ,
            x_ph                                        ,
            x_pl                                        ;
reg  [(8*21-1):0] char                                  ;
reg  [7:0]	num                                         ,
            char_reg                                    ;				
reg  [4:0]	cnt_main                                    ,
            cnt_init                                    ,
            cnt_scan                                    ,
            cnt_write                                   ;
reg  [15:0] num_delay                                   ,
            cnt_delay                                   ,
            cnt                                         ;
reg  [5:0]  state                                       ,
            state_back                                  ;
reg  [39:0] time_head                                   ;
reg  [95:0] temp_head                                   ;
wire [7:0]  sign                                        ;

//assign sign = tem_sign?" ":"+"                          ;

					 //num <= 5'd14;
					 //char <= {"  ",temp_head,sign,tem_1,tem_0,8'hae,tem_3,8'h7b,"  "};

always @(posedge clk or negedge rst)
    begin
	 if(!rst)
	     begin
		  cnt_main <= 1'b0; cnt_init <= 1'b0; cnt_scan <= 1'b0; cnt_write <= 1'b0;
		  y_p <= 1'b0; x_ph <= 1'b0; x_pl <= 1'b0;
		  num <= 1'b0; char <= 1'b0; char_reg <= 1'b0;
		  num_delay <= 16'd5; cnt_delay <= 1'b0; cnt <= 1'b0;
		  oled_csn <= HIGH; oled_rst <= HIGH; oled_dcn <= CMD; oled_clk <= HIGH; oled_dat <= LOW;
		  state <= IDLE; state_back <= IDLE;
		  end
    else
	     begin
		  case(state)
		        IDLE://1
				begin
				cnt_main <= 1'b0; cnt_init <= 1'b0; cnt_scan <= 1'b0; cnt_write <= 1'b0;
				y_p <= 1'b0; x_ph <= 1'b0; x_pl <= 1'b0;
				num <= 1'b0; char <= 1'b0; char_reg <= 1'b0;
				num_delay <= 16'd5; cnt_delay <= 1'b0; cnt <= 1'b0;
				oled_csn <= HIGH; oled_rst <= HIGH; oled_dcn <= CMD; oled_clk <= HIGH; oled_dat <= LOW;
				state <= MAIN; state_back <= MAIN;
				end
				MAIN:begin//2
					if(cnt_main >= 8)
						cnt_main <= 1;
					else
						cnt_main <= cnt_main+1'b1;
					case(oled_mode)
						4'd0:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd1:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd2:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd3:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd4:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd5:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd6:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",curr_hour1,curr_hour0,":",curr_min1,curr_min0,":",curr_sec1,curr_sec0,"     "};state <= SCAN;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",next_hour1,next_hour0,":",next_min1,next_min0,":",next_sec1,next_sec0,"     "};state <= SCAN;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     Deadline     "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"     ",diff_hour1,diff_hour0,":",diff_min1,diff_min0,":",diff_sec1,diff_sec0,"     "};state <= SCAN;end
								 default: state <= IDLE;
							endcase
						end
						4'd7:begin
							case(cnt_main)
								5'd0:begin state <= INIT;end
								5'd1:begin y_p <= 8'hb0;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[0];state <= CHINESE;end
								5'd2:begin y_p <= 8'hb1;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[1];state <= CHINESE;end
								5'd3:begin y_p <= 8'hb2;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[2];state <= CHINESE;end
								5'd4:begin y_p <= 8'hb3;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[3];state <= CHINESE;end
								5'd5:begin y_p <= 8'hb4;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[4];state <= CHINESE;end
								5'd6:begin y_p <= 8'hb5;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= choice[5];state <= CHINESE;end
								5'd7:begin y_p <= 8'hb6;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"    1120213184    "};state <= SCAN;end
								5'd8:begin y_p <= 8'hb7;x_ph <= 8'h10;x_pl <= 8'h00;num <= 5'd16;char <= {"    1120213284    "};state <= SCAN;end
									default: state <= IDLE;
							endcase
						end
					endcase	
				end
				INIT://3
				begin	//闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋涢ˇ鐢稿极瀹ュ绀嬫い鎺嶇劍椤斿洦绻濆閿嬫緲閳ь剚娲熷畷顖烆敍濮樿鲸娈鹃梺鍝勮閸庢煡鎮￠弴鐘亾閸忓浜鹃梺閫炲苯澧寸€规洘娲熼獮瀣偐閻㈡妲搁梻浣告惈缁嬩線宕㈡禒瀣亗婵炲棙鎸婚悡鐔镐繆閵堝倸浜鹃梺缁橆殔閿曪箑鈻庨姀銈嗗殤妞ゆ帒鍊婚敍婊堟⒑闁偛鑻晶顕€鏌ｉ敐鍡欑疄鐎规洜鍠栭、妤呭磼濮橆剛顔囬梻浣筋嚙妤犲摜绮诲澶婄？閺夊牜鐓堝▓浠嬫煕濞戞﹫鍔熸い鈺佸级缁绘繃绻濋崒娑樻缂備胶濮靛Λ鍐蓟閻斿憡缍囧Δ锝呭暞椤庡秹姊洪幎鑺ユ暠闁搞劌娼￠獮鍐亹閹烘垹鍊為梺鎸庣箓閸婂憡绂嶆ィ鍐╃厱闁归偊鍘鹃妶鎾煙缁嬪灝顏慨濠勭帛閹峰懘鎮滃Ο鐑樼暚闂備焦鎮堕崐鏍偋閻樿崵宓侀煫鍥ㄧ⊕閺呮悂鏌ㄩ悤鍌涘
				case(cnt_init)
				    5'd0:   begin oled_rst <= LOW; cnt_init <= cnt_init + 1'b1; end	//婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柛娑橈攻閸欏繐霉閸忓吋缍戦柛銊ュ€块弻锝夊箻瀹曞洤鍝洪梺鍝勵儐閻楁鎹㈠☉銏犵闁绘劕顕▓銈夋⒑濞茶骞楅柟鎼佺畺閸┾偓妞ゆ帒鍠氬鎰箾閸欏澧悡銈夋煏婵炑冩噽閻掑吋绻濋悽闈浶㈡繛璇х畵閹繝寮撮悢铏诡啎闂佺懓顕崑鐔煎箠閸曨厾纾界€广儱妫楅悘鎾煙椤旂瓔娈旀い顐ｇ箞椤㈡寰勭€ｆ搫绠戦—鍐Χ鎼粹€崇哗濠电偛顦板ú鐔肩嵁閹达箑绀嬫い鎺戝€婚幊婵嗩渻閵堝棛澧柤鍦亾缁旂喐寰勭€ｎ剛鐦堥梺姹囧灲濞佳勭濠婂牊鐓欓梺鍨儏閻忓瓨顨ラ悙鑼闁轰焦鎹囬弫鎾绘晸閿燂拷
					 5'd1:   begin num_delay <= 16'd25000; state <= DELAY; state_back <= INIT; cnt_init <= cnt_init + 1'b1; end	//闂傚倸鍊搁崐宄懊归崶顒夋晪鐟滃秹婀侀梺缁樺灱濡嫮澹曟繝姘叆婵犻潧妫Σ鍝ョ棯閹规劦娼愮紒缁樼洴楠炲鈻庤箛鏇氭偅闂備礁鎼€氥劑宕曢悽绋胯摕闁炽儱纾弳銈嗐亜閺傚灝鎮戞繝鈧导瀛樺€甸梻鍫熺〒閻掑憡鎱ㄦ繝鍛仩缂侇喗鐟╅獮鎰償閵忊€愁伆缂傚倸鍊风粈渚€顢栭崱娑樺瀭闁荤喐澹嬮弸搴ㄦ煏韫囧鈧牠宕愰悜鑺ョ厱妞ゎ厽鍨垫禍婊堟煛鐎ｎ偄鐏撮柟顔筋殜瀹曟寰勬繝浣割棜闂傚倷绶氶埀顒傚仜閼活垱鏅堕幘顔界厵鐎规洖娲ゆ禒閬嶆煛鐏炶姤顥滄い鎾炽偢瀹曞崬螣濞茶鎴烽梻鍌氬€峰ù鍥р枖閺囥垹闂柨鏇炲€哥粻顖炴煥閻曞倹瀚�3us
					 5'd2:   begin oled_rst <= HIGH; cnt_init <= cnt_init + 1'b1; end	////婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柛娑橈攻閸欏繐霉閸忓吋缍戦柛銊ュ€块弻锝夊箻瀹曞洤鍝洪梺鍝勵儐閻楁鎹㈠☉銏犵闁绘劕顕▓銈夋⒑濞茶骞楅柟鎼佺畺閸┾偓妞ゆ帒鍠氬鎰箾閸欏澧悡銈夋煏婵炑冩噽閻掑吋绻濋悽闈浶㈡繛璇х畵閹繝寮撮悢铏诡啎闂佺懓顕崑鐔煎箠閸曨厾纾界€广儱妫楅悘鈺冪磼鏉堛劌娴柟顔规櫊瀹曟﹢宕ｆ径搴ｆ闂傚倷绀侀幖顐﹀嫉椤掆偓鐓ゆ繝闈涚墢娑撳秵绻涢幋娆忕仼闁告濞婇弻锝夊箣濠靛浂妫忛梺绋款儐閹哥偓绂掗敃鍌氱煑闁靛／鍛毎闂備浇宕垫慨鏉戔枖瑜斿畷鐔碱敃椤愶紕澶�
					 5'd3:   begin num_delay <= 16'd25000; state <= DELAY; state_back <= INIT; cnt_init <= cnt_init + 1'b1; end	//闂傚倸鍊搁崐宄懊归崶顒夋晪鐟滃秹婀侀梺缁樺灱濡嫮澹曟繝姘叆婵犻潧妫Σ鍝ョ棯閹规劦娼愮紒缁樼洴楠炲鈻庤箛鏇氭偅闂備礁鎼€氥劑宕曢悽绋胯摕闁炽儱纾弳銈嗐亜閺傚灝鎮戞繝鈧导瀛樺€甸梻鍫熺〒閻掑憡鎱ㄦ繝鍛仩缂侇喗鐟╅獮鎰償閵忊€愁伆缂傚倸鍊风粈渚€顢栭崱娑樺瀭闁荤喐澹嬮弸搴ㄦ煏韫囧鈧牠宕愰悜鑺ョ厱妞ゎ厽鍨垫禍婊堟煛鐎ｎ偄鐏撮柟顔筋殜瀹曟寰勬繝浣割棜闂傚倷绶氶埀顒傚仜閼活垱鏅堕幘顔界厵鐎规洖娲ゆ禒閬嶆煛鐏炶姤顥滄い鎾炽偢瀹曞崬螣濞茶鎴烽梻鍌氬€峰ù鍥р枖閺囥垹闂柨鏇炲€哥粻顖炴煥閻曞倹瀚�220us
					 5'd4:   begin 
								if(cnt>=INIT_DEPTH) 
								    begin	//闂傚倸鍊搁崐宄懊归崶褏鏆﹂柣銏㈩焾缁愭鏌熼柇锕€鏋涢柛銊︾箞閹﹢鎮欓棃娑楀闂佺娴烽崰鎰崲濠靛洨绡€闁稿本绮岄。铏圭磽娴ｅ搫顎岄柛銊ョ埣瀵濡搁埡鍌氫簽闂佺鏈粙鎴︻敂閿燂拷25闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋為悧鐘汇€侀弴姘辩Т闂佹悶鍎洪崜锕傚极閸愵喗鐓ラ柡鍥殔娴滃墽绱撴担鎻掍壕闂佸壊鍋嗛崰鎾跺姬閳ь剟姊婚崒姘卞缂佸鎸婚弲鍫曞箛閻楀牏鍘遍柣搴秵閸嬪懎鐣峰畝鈧埀顒冾潐濞叉牜绱炴繝鍥モ偓渚€寮撮姀鐘栄囧箹濞ｎ剙鐏い鏃€鍔楃槐鎾诲磼濮橆兘鍋撴搴ｇ焼濞撴埃鍋撶€规洘鍔欏畷鐑筋敇閻斿憡顔囬梻浣规灱閺呮盯宕埡鍐╁床闁糕剝绋掗悡鏇熴亜閹板墎绋荤紒鈧埀顒勬倵閻熺増鍟炵紒璇插暣婵＄敻宕熼姘鳖啋闁荤姾娅ｉ崕銈夋倵婵犳碍鈷戞慨鐟版搐婵℃悂鏌涢弮鈧崹鐢革綖韫囨洜纾兼俊顖濐嚙椤庢捇姊洪崗闂磋埅闁稿寒鍨堕崺鈧い鎺嗗亾闁哥喐鎸冲濠氬Χ閸ワ絽浜鹃柛锔诲幖瀛濋梺缁樻尰閸旀瑩寮婚敓鐘插窛闁绘鐗忛妴鎰版煣缂佹澧甸柡灞界Х椤т線鏌涢幘璺烘灈妤犵偛鍟妶锝夊礃閵娿儳鈧厼顪冮妶鍡楀闁稿﹥顨婇獮濠傗攽鐎ｎ偀鎷洪梻渚囧亞閸嬫盯鎳熼娑欐珷妞ゆ洍鍋撻柡宀嬬秮閺佹劙宕惰楠炲姊烘潪鎵妽闁告梹鐗曢銉╁礋椤掑倻鐦堥梺鍛婃礋濞佳囧箖閸績鏀介柣妯虹仛閺嗏晛鈹戦悙鈺佷壕婵犵數鍋橀崠鐘诲礂閻愵剛鈽夐柍璇查叄楠炴﹢寮堕幋婵嗏挄闂傚倷绀侀幖顐﹀疮椤愶附鍋嬪┑鐘叉搐閻撴洟鏌熸潏楣冩闁绘挻娲樼换娑㈠箣閻戝洤鍙曟慨鎺濆亝閼归箖鈥︾捄銊﹀枂闁告洘鍎奸埀顒€娼￠弻锛勪沪閸撗勫垱濡ょ姷鍋涢澶愬箖閳哄懏鎯炴い鎰╁€曞☉褍鈹戦悩娈挎毌闁逞屽墮閸熻法鐥閺屾盯寮埀顒€煤閻旂厧鏄ラ柣鎰惈缁狅綁鏌ｅ鍡椾簻濞存粓绠栭弻銊モ攽閸℃侗鈧霉濠婂懎浠遍柡灞剧☉铻ｉ悹鍥ㄥ絻椤帡姊虹拠鈥虫灍妞ゃ劌锕幃浼搭敋閳ь剙鐣疯ぐ鎺濇晩闁绘挸瀵掑娑樷攽閻樺灚鏆╅柛瀣洴閹洦瀵奸弶鎴狀槷闂佺懓鐡ㄧ换宥夊吹閺囥垺鐓欓梻鍌氼嚟椤︼妇鐥幆褋鍋㈤柡宀嬬秮楠炲洭顢橀悢铏光枏闂備線鈧偛鑻晶浼存煛娴ｅ壊鐓肩€殿喖顭烽弫鎰緞鐎ｎ亙绨婚梻浣告啞缁诲倻鈧氨鍏樺鎶筋敇閻愨晜鏂€闂佺粯锕╅崑鍕閻愵剛绠鹃悗鐢殿焾鐢爼鏌ｆ幊閸旀垿骞冮敓鐘插嵆闁绘梻绻濈花璇差渻閵堝棙灏甸柛鐘叉捣缁厼顫濋懜闈涒偓鍨叏濡厧浜鹃悗姘炬嫹
								    cnt <= 1'b0;
								    cnt_init <= cnt_init + 1'b1;
									 end 
								else 
								    begin	
									 cnt <= cnt + 1'b1; 
									 num_delay <= 16'd5;
									 oled_dcn <= CMD; 
									 char_reg <= cmd[cnt]; 
									 state <= WRITE; 
									 state_back <= INIT;
									 end
								end
                5'd5:	begin cnt_init <= 1'b0; state <= MAIN; end	//闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋涢ˇ鐢稿极瀹ュ绀嬫い鎺嶇劍椤斿洦绻濆閿嬫緲閳ь剚娲熷畷顖烆敍濮樿鲸娈鹃梺鍝勮閸庢煡鎮￠弴鐘亾閸忓浜鹃梺閫炲苯澧寸€规洘娲熼獮瀣偐閻㈡妲搁梻浣告惈缁嬩線宕㈡禒瀣亗婵炲棙鎸婚悡鐔镐繆閵堝倸浜鹃梺缁橆殔閿曪箑鈻庨姀銈嗗殤妞ゆ帒鍊婚敍婊堟⒑闁偛鑻晶顕€鏌ｉ敐鍡欑疄鐎规洜鍠栭、妤呭磼濮橆剛顔囬梻浣筋嚙濮橈箓锝炴径鎰闁冲搫鎳庣粣妤呮煛瀹ュ骸骞栫紒鐘靛█閻擃偊宕堕妸锕€鐨戦梺鍝勵儐濮婂綊濡甸崟顖氬嵆婵°倐鍋撳ù婊勫劤閳规垿顢欑涵閿嬫暰濠碉紕鍋樼划娆撶嵁閸愵喗鍊婚柦妯侯槺椤撶厧顪冮妶鍡橆梿濠殿喓鍊濆畷浼村冀椤撶啿鎷绘繛杈剧到閹诧繝宕悙鐑樼厸閻庯綁娼у▍宥団偓瑙勬磸閸旀垿銆佸璺哄窛妞ゆ柨澧介埣銉︾節閻㈤潧啸闁轰礁鎲＄换娑㈠焵椤掍胶绠惧ù锝呭暱閸樻儳煤椤忓懏娅嗛梺浼欑到閻牆煤閹间焦鈷戦梻鍫熺〒婢ф洘銇勯敂鍨祮闁诡喒鈧枼妲堥柕蹇ョ磿閸橀亶鏌ｈ箛鏇炰粶濠⒀傜矙閸┿儲寰勭€ｃ劋绨婚梺鍝勬川閸犳捇鎯屽畝鈧槐鎺撴綇閵娿儲璇為梺绯曟杹閸嬫挸顪冮妶鍡楃瑨閻庢凹鍓熼幃鐐烘偨閸涘﹦鍘介梺缁樺姇瀵墎绮婚悿妤撮梻鍌氬€搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀姹楅梺閫炲苯澧剧紒鐘虫尭閻ｉ攱绺界粙璇俱劑鏌曟径娑㈡鐞氾綁姊婚崒娆戭槮闁圭⒈鍋嗙划娆愮瑹閳ь剙鐣烽姀锛勯檮闁告稑锕ら埀顒€娼￠弻娑⑩€﹂幋婵呯按婵炲瓨绮嶇划鎾诲蓟閻斿吋鍊绘俊顖濇閸樻劙姊虹悰鈥充壕婵犵數濮电喊宥夊磹閸偅鍙忔俊顖滃帶娴滈箖鎮楀鐐
					 default: state <= IDLE;
            endcase
				end
				SCAN://4
				begin	//闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋涢ˇ鐢稿极瀹ュ绀嬫い鎺嶇劍椤斿洭姊绘担鍛婅础闁稿簺鍊濋妴鍐川椤旇棄鍔呮繝鐢靛Т濞诧箓鎮″☉銏″€堕柣鎰邦杺閸ゆ瑩鏌涢弮鈧划鎾诲蓟濞戞瑦鍎熼柕蹇娾偓宕囷紦闂備礁鎼張顒勬儎椤栫偛鏄ラ柛鏇ㄥ灠缁€鍐┿亜韫囧海顦︽い顐㈢焸濮婄粯鎷呮笟顖滃姼濡炪倖鍨靛Λ婵嗙暦濠靛棌鏋庨柟鎯х枃閹芥洟姊洪棃娑氬妞わ富鍨辩€靛ジ鎮╃紒妯煎帾婵犮垼鍩栭敋闁哄鍠愰幈銊╂晲閸涱垳鍔┑顔硷龚濞咃絿鍒掑▎蹇婃瀻闁诡垎鍐棊闂傚倷娴囬～澶愭偤閺囩偟鏆﹂柣銏ゆ涧閸ㄦ繃銇勯幘鍗炵仾闁稿瀚伴弻娑樷攽閸曨偄濮㈤梺浼欑畱閻楁挸顫忓ú顏勫窛濠电姴鍟ˇ鈺呮⒑閸涘﹦鎳冨Δ鐘殿焾瀹撳嫰鎮楅悷鏉款仾濠㈢懓顑夊銊︾鐎ｎ偆鍘介梺褰掑亰閸撴岸鍩㈤弴銏＄厱闁靛牆娲ら弸搴ㄦ煃鐟欏嫬鐏存い銏＄懇閹崇偤濡烽妷銉︽暘闂佽姘﹂～澶娒哄鈧垾锕傚炊椤掍礁浠忔俊銈忕到閸燁偆绮堥崟顑句簻闊洦鎸搁銈夋煛閳ь剚绂掔€ｎ偆鍘介梺褰掑亰閸樼晫绱為幋锔界厽闊洢鍎抽悾鐢告煛瀹€鈧崰鎾寸閹间礁鍐€闁靛濡囪ぐ瀣煟鎼淬値娼愭繛娴嬫櫇缁辩偞绗熼埀顒€鐣峰ú顏勭劦妞ゆ帊闄嶆禍婊堟煙閸濆嫮效婵℃儳鍢查湁婵犲﹤瀚惌鎺楁煛瀹€瀣瘈鐎规洖鐖兼俊鎼佸Ω閵夘喗顥ら梺璇叉唉椤骞愮粙璇炬稑鈽夐姀鐘靛姦濡炪倖甯掗崰姘焽閹邦厾绠炬繛鏉戭儐濞呭洨绱掓潏鈺佷沪闁瑰嘲鎳樺畷婊堝箵閹烘搩鍚欐繝鐢靛仜椤曨厽鎱ㄩ幘顕呮晞闁告侗鍠栭崝鏃堟⒒閸屾瑧鍔嶉悗绗涘喚娼栧┑鐘崇閸嬨倝鏌￠崘銊у闁汇値鍣ｉ弻宥堫檨闁告挾鍠庨～蹇旂節濮橆剛锛滃┑鐐叉鐢帡宕㈤垾鎰佹富闁靛牆鍟悘鈺呮煥閺囥劋閭柕鍡曠椤繄鎹勯崫鍕暏婵＄偑鍊栭幐楣冨磻閻斿吋鍋橀柕澶嗘櫆閳锋垿鏌涘┑鍡楊伀闁宠顦甸弻娑樜熼幁鎺戜划閻庢鍠曢崡铏繆閻戣姤鏅滈柛鎾楀苯鏅梻鍌欒兌閹虫捇顢氶銏犵；闁绘柨鍚嬮崑鍌涖亜閺嶃劎銆掔紒鐘插⒔閳ь剙鍘滈崑鎾斥攽閻樿京绐旈柛瀣殜濮婃椽宕崟顕呮蕉闂佸憡姊归崹鍧楃嵁閸愵喖围濠㈣泛锕﹂敍婊冣攽閻愭潙鐏﹂柨鏇楁櫆鐎靛ジ鏁撻敓锟�
				if(cnt_scan == 5'd11) 
				    begin
					 if(num) 
					     cnt_scan <= 5'd3;
					 else 
					     cnt_scan <= cnt_scan + 1'b1;
					 end 
				else if(cnt_scan == 5'd12) 
				    cnt_scan <= 1'b0;
				else 
				    cnt_scan <= cnt_scan + 1'b1;
				case(cnt_scan)
				    5'd 0:	begin oled_dcn <= CMD; char_reg <= y_p; state <= WRITE; state_back <= SCAN; end		//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪Ч閿濈偛鈹戠€ｎ偅娅囬梺绋跨焿婵″洨绮欒箛鏃傜瘈闁靛骏绲介悡鎰版煕閺冣偓閻楃姴鐣烽弴鐐嶆梹鎷呴崗鍝ョ泿闂備礁鎼崐鎼佹倶濠靛鐓曢柡鍐ㄥ€荤壕濂告煃瑜滈崜姘辨崲濠靛鐐婇柕濞у啫绠炲┑鐘垫暩閸嬬偤宕归崼鏇熷仭闁挎柨澧界粈濠囨煙鐎电啸缁炬儳銈搁弻宥堫檨闁告挾鍠庨悾鐑藉础閻愬秶鍠栧畷鐑筋敇閻樺灚姣庨梻鍌氬€风欢姘焽瑜旈幃褔宕卞☉妯肩枃闂婎偄娲︾粙鎴︽⒒椤栫偞鐓熼柟杈剧到琚氶梺缁樻尭閸熶即骞夌粙娆剧叆闁割偅绻勯ˇ顓炩攽閻愬弶顥為柟閿嬬叀瀹曞爼顢楁笟鍥棃婵犵數鍋為崹鍓佸枈瀹ュ應鏋斿Δ锝呭暞閳锋垹绱撴担濮戭亪鎮樻潏銊ょ箚妞ゆ劑鍨归顐︽煟閵夘喕娴锋い锕€缍婇弻鈥崇暆閳ь剟宕伴幘璺哄灊婵炲棙鎸哥粻浼村箹濞ｎ剙鐏╅梻鍌ゅ灣缁辨捇宕掑▎鎰垫▊缂備浇缈伴崐婵嬬嵁韫囨稒鏅搁柨鐕傛嫹
					 5'd 1:	begin oled_dcn <= CMD; char_reg <= x_pl; state <= WRITE; state_back <= SCAN; end	//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪Ч閿濈偛鈹戠€ｎ偅娅囬梺绋跨焿婵″洨绮欒箛鏃傜瘈闁靛骏绲介悡鎰版煕閺冣偓閻楃姴鐣烽弴鐐嶆梹鎷呴崗鍝ョ泿闂備礁鎼崐鎼佹倶濠靛鐓曢柡鍐ㄥ€荤壕濂告煃瑜滈崜姘辨崲濠靛鐐婇柕濞у啫绠炲┑鐘垫暩閸嬬偤宕归棃娑氭殾妞ゆ帒瀚崐鍫曟煥閻斿搫校闁绘挻娲熼幃妤呮晲鎼粹€插闂佸吋婢樺锟犲蓟閻旂⒈鏁婇柡鍌樺€涢埀顒€娼￠弻鐔碱敊閻ｅ本鍣梺鍦嚀鐎氫即骞嗛崟顖氱闁圭偓娼欑壕鎶芥⒑閸濆嫭婀伴柣鈺婂灠椤曪綁骞橀纰辨綂闂侀潧绻堥崹鍝勑掗崶顒佲拻濞达絽鎲￠幆鍫ユ煛閸偄澧扮紒顔界懇瀵粙顢橀崟顐ｅ枠妞ゃ垺宀搁崺鈧い鎺戝閽冪喐绻涢幋鐐茬劰闁稿鎹囬弫鎰償閳ヨ尙鍑归梺璇茬箰濞存岸宕ｉ崘銊庢稒鎷呴悷鎵獮闂佸綊鍋婇崢楣冨矗閸℃せ鏀介柣妯肩帛濞懷勪繆椤愶絿鎳囩€规洝娅曠粋鎺斺偓锝庡亞閸橀亶姊洪悷鎵憼缂佽鍟伴幏褰掓晬閸曨厾锛滈柡澶婄墑閸斿秶浜搁鐔翠簻闁瑰墽鎳撻ˉ宥囩磼閻樺磭娲寸€殿噮鍓欓埢搴ㄥ矗閵壯冾槱
					 5'd 2:	begin oled_dcn <= CMD; char_reg <= x_ph; state <= WRITE; state_back <= SCAN; end	//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪Ч閿濈偛鈹戠€ｎ偅娅囬梺绋跨焿婵″洨绮欒箛鏃傜瘈闁靛骏绲介悡鎰版煕閺冣偓閻楃姴鐣烽弴鐐嶆梹鎷呴崗鍝ョ泿闂備礁鎼崐鎼佹倶濠靛鐓曢柡鍐ㄥ€荤壕濂告煃瑜滈崜姘辨崲濠靛鐐婇柕濞у啫绠炲┑鐘垫暩閸嬬偤宕归棃娑氭殾妞ゆ帒瀚崐鍫曟煥閻斿搫校闁绘挻娲熼幃妤呮晲鎼粹€插闂佸吋婢樺锟犲蓟閻旂⒈鏁婇柡鍌樺€涢埀顒€娼￠弻鐔碱敊閻ｅ本鍣梺鍦嚀鐎氫即骞嗛崟顖氱闁圭偓娼欑壕鎶芥⒑閸濆嫭婀伴柣鈺婂灠椤曪綁骞橀纰辨綂闂侀潧绻堥崹鍝勑掗崶顒佲拻濞达絽鎲￠幆鍫ユ煛閸偄澧扮紒顔界懇瀵粙顢橀崟顐ｅ枠妞ゃ垺宀搁崺鈧い鎺戝閽冪喐绻涢幋鐐茬劰闁稿鎹囬弫鎰償閳ヨ尙鍑归梺璇茬箰濞存岸宕ｉ崘顔肩闁割偅娲栭崘鈧銈嗘尵閸犳捇宕㈤柆宥嗙厽闊洦娲栨禒锔锯偓瑙勬礃閿曘垽宕洪埀顒併亜閹达絾纭堕柣顓熺懇閺岀喖鎼归銈呪拰闂佺硶鏅换婵嗙暦濮椻偓椤㈡柨顓奸崰甯畵濮婂宕掑▎鎰偘濠电偛顦板ú鐔风暦閹惰姤鏅濋柛灞炬皑椤斿棝姊虹捄銊ユ珢闁瑰嚖鎷�
							
					 5'd 3:	begin num <= num - 1'b1;end
					 5'd 4:	begin oled_dcn <= DATA; char_reg <= 8'h00; state <= WRITE; state_back <= SCAN; end	//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
					 5'd 5:	begin oled_dcn <= DATA; char_reg <= 8'h00; state <= WRITE; state_back <= SCAN; end	//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
					 5'd 6:	begin oled_dcn <= DATA; char_reg <= 8'h00; state <= WRITE; state_back <= SCAN; end	//闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
					 5'd 7:	begin oled_dcn <= DATA; char_reg <= mem[char[(num*8)+:8]][39:32]; state <= WRITE; state_back <= SCAN; end
					 5'd 8:	begin oled_dcn <= DATA; char_reg <= mem[char[(num*8)+:8]][31:24]; state <= WRITE; state_back <= SCAN; end
					 5'd 9:	begin oled_dcn <= DATA; char_reg <= mem[char[(num*8)+:8]][23:16]; state <= WRITE; state_back <= SCAN; end
					 5'd10:	begin oled_dcn <= DATA; char_reg <= mem[char[(num*8)+:8]][15: 8]; state <= WRITE; state_back <= SCAN; end
					 5'd11:	begin oled_dcn <= DATA; char_reg <= mem[char[(num*8)+:8]][ 7: 0]; state <= WRITE; state_back <= SCAN; end
					 5'd12:	begin state <= MAIN; end
					 default: state <= IDLE;
				endcase
			   end
                CHINESE:begin  //閺勫墽銇氬Ч澶婄摟
                    if(cnt_scan == 5'd11) begin
                        if(num) cnt_scan <= 5'd3;
                        else cnt_scan <= cnt_scan + 1'b1;
                        end else if(cnt_scan == 5'd12) cnt_scan <= 1'b0;
                        else cnt_scan <= cnt_scan + 1'b1;
                    case(cnt_scan)
                        5'd 0:  begin oled_dcn <= CMD; char_reg <= y_p; state <= WRITE; state_back <= CHINESE; end     //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                        5'd 1:  begin oled_dcn <= CMD; char_reg <= x_pl; state <= WRITE; state_back <= CHINESE; end    //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                        5'd 2:  begin oled_dcn <= CMD; char_reg <= x_ph; state <= WRITE; state_back <= CHINESE; end    //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                            
                        5'd 3:  begin num <= num - 1'b1;end
                        5'd 4:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][63:56];state <= WRITE; state_back <= CHINESE; end
                        5'd 5:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][55:48];state <= WRITE; state_back <= CHINESE; end
                        5'd 6:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][47:40];state <= WRITE; state_back <= CHINESE; end
                        5'd 7:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][39:32];state <= WRITE; state_back <= CHINESE; end
                        5'd 8:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][31:24];state <= WRITE; state_back <= CHINESE; end
                        5'd 9:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][23:16];state <= WRITE; state_back <= CHINESE; end
                        5'd10:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][15:8];state <= WRITE; state_back <= CHINESE; end
                        5'd11:  begin oled_dcn <= DATA; char_reg<=mem_chinese[char[(num*8)+:8]][7:0];state <= WRITE; state_back <= CHINESE; end
                        5'd12:  begin state <= MAIN; end
                        default: state <= IDLE;
                    endcase
                end
                CHINESE_FAN:begin  //婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柟闂寸绾惧鏌ｉ幇顒佹儓闁搞劌鍊块弻娑㈩敃閿濆棛顦ョ紓浣哄Т缂嶅﹪寮诲澶婁紶闁告洦鍓欏▍锝夋⒑缁嬭儻顫﹂柛鏂跨焸濠€渚€姊虹紒妯忣亜螣婵犲洤纾块煫鍥ㄧ⊕閻撴洟鏌熺€电孝闁宠鐗撻弻锛勪沪閸撗勫垱濡ょ姷鍋涘ú顓熶繆閹间焦鏅滈柣锝呰嫰缁茬偓绻濋悽闈涗粶闁宦板姂瀹曞灚鎯旈妸銉э紮濠电娀娼ч鍛存嫅閻斿吋鐓ラ柣鏂挎惈瀛濈紒鐐劤閸氬鎹㈠☉銏犵闁绘垵娲ｇ欢鐢告⒑閹肩偛鈧洟顢栨径濠庢綎闁惧繐婀遍惌娆撴煕閺嶃倐鍋撻崗鍛煑濠碉紕鍋戦崐銈夊储妤ｅ啫绀傛俊顖欒閸ゆ洖鈹戦悩宕囶暡闁哄懏鎮傞弻锝呂熼崹顔炬濡炪倧闄勫姗€鈥旈崘顔嘉ч柛鈩冾殔椤懘姊洪悷鏉挎毐婵炲樊鍙冮悰顕€骞囬弶璺槰濡炪倖妫佽闁归攱妞藉濠氬磼濮樺崬顤€缂備礁顑嗙敮鐐靛垝婵犲浂鏁冮柨鏃傛櫕閸樼敻姊洪崨濠傜仧闁稿﹥鐗滈埀顒佺啲閹凤拷---------8
                    if(cnt_scan == 5'd11) begin
                        if(num) cnt_scan <= 5'd3;
                        else cnt_scan <= cnt_scan + 1'b1;
                        end else if(cnt_scan == 5'd12) cnt_scan <= 1'b0;
                        else cnt_scan <= cnt_scan + 1'b1;
                    case(cnt_scan)//12鐏忓繑妞�
                        5'd 0:  begin oled_dcn <= CMD; char_reg <= y_p; state <= WRITE; state_back <= CHINESE_FAN; end     //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                        5'd 1:  begin oled_dcn <= CMD; char_reg <= x_pl; state <= WRITE; state_back <= CHINESE_FAN; end    //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                        5'd 2:  begin oled_dcn <= CMD; char_reg <= x_ph; state <= WRITE; state_back <= CHINESE_FAN; end    //闂傚倸鍊搁崐鎼佸磹瀹勬噴褰掑炊椤掑鏅悷婊冪箻楠炴垿濮€閵堝懐鐤€濡炪倖鎸嗛崟闈涙櫖闂傚倸顭崑鍕洪敂鍓х煓闁瑰濮锋稉宥嗐亜閺嶎偄浠﹂柣鎾卞劦閺岋綁寮撮悙娴嬪亾閸︻厸鍋撳鐐5*8闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀绮剁紓浣插亾濠㈣埖鍔栭悡娑㈡煕閵夈垺娅呴崯鍝ョ磽娴ｆ彃浜炬繝鐢靛Т閸婄敻寮ㄦ禒瀣厽婵☆垰鐏濈槐锕傚级閳轰胶绉洪柡宀嬬秮瀵噣宕掑顑跨帛闂備胶绮敮鎺楁倶濮樿泛桅闁告洦鍨扮粻鎶芥煙鐎涙濡囬柛瀣崌閹筹繝濡堕崪浣诡棥濠电偛顕慨鎾敄閸℃稒鍋傞柡鍥ュ灪閸婂爼鏌ｉ幇顓炵祷闁抽攱妫冮弻鏇㈠幢濡櫣鐟ㄥ銈庡弨閸庡藝閻熸噴鐟邦煥閸愵亜鐓熼悗娈垮枦椤曆囶敇婵傜骞㈡俊銈咃工濞堝吋绻濋悽闈涗粶婵☆偅鐟╁畷婵嬪即閵忊晜鏅滈梺璺ㄥ櫐閹凤拷8*8
                            
                        5'd 3:  begin num <= num - 1'b1;end
                        5'd 4:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][63:56];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd 5:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][55:48];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd 6:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][47:40];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd 7:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][39:32];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd 8:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][31:24];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd 9:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][23:16];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd10:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][15:8];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd11:  begin oled_dcn <= DATA; char_reg<=~mem_chinese[char[(num*8)+:8]][7:0];state <= WRITE; state_back <= CHINESE_FAN; end
                        5'd12:  begin state <= MAIN; end
                        default: state <= IDLE;
                    endcase
                end
				WRITE://5
				begin	////WRITE闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢幘鑼槮闁搞劍绻冮妵鍕冀椤愵澀姹楅梺閫炲苯澧剧紒鐘虫尭閻ｉ攱绺界粙璇俱劑鏌曟径娑㈡鐞氾綁姊婚崒娆戭槮闁圭⒈鍋嗙划娆愮瑹閳ь剙鐣烽姀锛勯檮闁告稑锕ら埀顒€娼￠弻娑⑩€﹂幋婵呯按婵炲瓨绮嶇划鎾诲蓟閻斿憡缍囬柛鎾楀惙鎴犵磼缂併垹骞栧褍娴峰Σ鎰板箳閹存梹顫嶅┑鈽嗗灥閸嬫劙顢欐繝鍕＝濞达絼绮欓崫娲偨椤栨侗娈旀い顓炴穿缁犳稑鈽夊Ο婧炬櫇閹叉瓕绠涘☉娆忎患闂佺绻楅崑鎰不妤ｅ啯鍊垫繛鎴炵懐閻掍粙鏌ｉ鐑嗗剶闁哄瞼鍠栭、娆撴偂鎼存ê浜鹃柟闂寸劍閸嬧晠鏌ｉ幋锝嗩棄缁绢厸鍋撻梻浣虹帛閸旀洜绮旈崼鏇炵獥闁规崘鍩栭～鏇㈡煙閻戞ê鐒炬繛绗哄姂閺屾盯鍩勯崘鐐暦濠电偛鎳庨崯鏉戭潖婵犳艾纾兼慨姗嗗厴閸嬫捇鎮滈懞銉ユ畱闂佸壊鍋呭ú蹇涘焵椤戣法鍔嶇紒缁樼箞瀹曞爼鎳滈崹顐ｇ彣闂傚倷绀侀幖顐ょ矙娓氣偓瀹曘垽鎳栭埡鍐箵濠德板€撳鎺旀崲閸℃稒鐓忛柛顐ｇ箖閸ｅ綊鏌￠崱妤嬭含闁哄本绋撻埀顒婄秵閸嬪懎鐣峰畝鈧埀顒冾潐濞叉牜绱炴繝鍥モ偓渚€寮撮姀鐘栄囨煕閵夈垺娅呴悽顖樺姂濮婂宕掑▎鎰偘濡炪倖娲橀悧鐘茬暦閹剁瓔鏁嶆繝濠傚鎼村﹤鈹戦悩缁樻锭妞ゆ垵鎳橀幃姗€骞庨懞銉у幐闂佺鏈笟妤呭磿閵夛妇绠剧紒妤€鎼慨鍌炴煛瀹€瀣М闁糕晜顨婇崺鈩冩媴瀹勯偊妫滈梻鍌氬€搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋為悧鐘汇€侀弴銏℃櫇闁逞屽墴閹潡顢氶埀顒勫蓟濞戙垹绠涙い鎾跺О閸嬬偤姊洪崫鍕靛剱闁绘顨堥幑銏犫槈閵忕姷顓洪梺缁樺姍椤ｏ妇鈧稈鏅滅换婵嗏枔閸喗鐏曞┑鐐叉噺濞茬喐淇婇悽绋跨妞ゆ牗姘ㄩ鎺楁⒑閸涘娈橀柛瀣枑缁傛帗绺介崨濞炬嫼濠电偠灏褔鐛Δ浣典簻闁靛鍎婚煬顒傗偓娈垮枛椤兘骞冮姀銈呭窛濠电姴瀚倴闂傚倷鑳堕、濠囷綖婢舵劕绀夐柡鍥ュ灩缁犳牠鏌涘☉妯兼憼闁抽攱鍨圭槐鎺斺偓锝庡亽閸庛儵鏌涙惔銏犲闁哄瞼鍠撶划娆忊枎閸撗冩倯婵°倗濮烽崑娑氭崲濡櫣鏆﹂柕濞р偓閸嬫挸鈽夊▍铏灴瀹曟洟顢旈崱娆戯紲缂傚倷闄嶉崹褰掔嵁閺嶎厽鐓欓柛鎰叀閸欏嫰鏌熼鍡欑瘈妤犵偛顑夐弫鍌滄喆閿濆棗顏归梻浣藉吹婵潙煤閳哄啩鐒婃繛鍡樺灩娑撳秹鏌熼幆鏉啃撻柣鎾存礋閹鏁愭惔鈥茬敖闂侀潧妫欑敮锟犲蓟閻旇偐宓侀柛顭戝枤娴煎牆螖閻橀潧浠滄繛宸弮閵嗕礁鈻庨幘宕囩厬闂侀潧锛忛崨顔兼灀闂傚倸鍊搁崐宄懊归崶褉鏋栭柡鍥ュ灩闂傤垶鏌ㄩ弴鐐测偓鍝ョ不椤栫偞鐓ラ柣鏇炲€圭€氾拷
				if(cnt_write >= 5'd17) 
				    cnt_write <= 1'b0;
				else 
				    cnt_write <= cnt_write + 1'b1;
				case(cnt_write)
				    5'd 0:	begin oled_csn <= LOW; end	////9婵犵數濮烽弫鍛婃叏閻戣棄鏋侀柟闂寸绾惧鏌ｅΟ娆惧殭缂佺姴鐏氶妵鍕疀閹炬惌妫炵紓浣界堪閸婃繈寮婚敐澶嬫櫜闁告侗鍨虫导鍥⒑濞茶骞楅柟鐟版喘瀵鏁愭径濠庢綂闂侀潧绻嗛弲婵嬪礉缁嬪簱鏀芥い鏃€顑欏鎰版煟閹垮嫮绡€鐎殿喖顭烽弫鎰緞婵犲嫮娼夐梻浣侯焾閺堫剟鎳濋悙顒傤浄婵☆垵鍋愮壕钘壝归敐鍛儓鐎涙繈鎮楀▓鍨灈闁绘牕鍚嬫穱濠囨偨缁嬭法顦板銈嗙墬濮樸劑鎯堥崟顖涒拺闁硅偐鍋涢崝鎾煟韫囨梻绠炴鐐搭焽閹肩偓鎷呴崫銉ㄩ梺璇″枓閺呮繈骞栭悙顒傜懝闁搞儻闄勯幑锝夋⒑鐠囪尙绠伴柛鐔告綑椤繘鎼归崷顓犵厯闂佸湱顭堢€涒晠骞忛柆宥嗏拺濠靛倸澹婇弳鎺旂磼椤旂晫鎳囨鐐诧躬瀵粙顢橀悙闈涘箰闂備礁鎲￠崝锔界鐠轰綍锝夊箹娴ｅ厜鎷绘繛杈剧到閹诧繝宕悙灞傗偓鎺戭潩椤撗勭杹閻庤娲樺姗€锝炲┑鍫熷磯闁惧繒鎳撻獮鎺楁⒒娴ｅ憡鎯堥柛鐕佸亰閹勭節閸ャ劌浜楅梺鍝勬川閸犳挾寮ч埀顒勬⒒閸屾氨澧涚紒瀣浮钘熸繝濠傚娴滄粓鐓崶椋庡闂侇収鍨堕弻锛勪沪閸撗勫垱婵犵鈧磭鍩ｇ€规洖宕灃闁告劦浜濋崳顖炴⒒閸屾艾鈧煤閵堝＆鍥偨缁嬭儻鎽曢梺鎸庣箓閹峰顭囬妸鈺傜厱闁斥晛鍠氬▓鏇㈡煟韫囨挾澧︽慨濠冩そ閺屽懘鎮欓懠璺侯伃婵犫拃灞界仸闁哄矉绲借灃闁告劑鍓遍姀掳浜滈柡鍥朵簽缁夘喗顨ラ悙鏌ュ弰闁瑰磭鍋ゆ俊鐑藉Ψ閵堝洨娉块梻鍌氬€烽懗鍓佸垝椤栫偛绠扮紒瀣紩瑜版帗鍊荤紒娑橆儐閺呪晜绻濋姀锝嗙【妞ゎ収鍓欓妴鎺撶節濮橆厾鍘梺鍓插亝缁诲啴藟閻愭番浜滈柕澶堝劜椤ョ偛菐閸パ嶈含妞ゃ垺娲熸慨鈧柣娆屽亾濞寸姴澧界槐鎾存媴缁嬪簱鍋撻崷顓熸殰闁圭儤顨愮紞鏍ㄧ節婵犲倻澧曢柣鎺戠仛閵囧嫰骞掗幋婵愪患闂佽棄鍟伴崰鎰崲濞戙垹绠ｆ繛鍡楃箳娴犺偐绱撴担鍝勑ｅ┑鐐诧躬瀵鎮㈤悡搴ｇ暰閻熸粌绻橀獮妤呮偐缂佹鍘介柟鍏兼儗閸犳牠鎮橀敐鍥╃＜閺夊牄鍔嶅畷宀€鈧娲樼敮鎺楋綖濠靛绠ュù锝呮贡閳ь剚鎮傚缁樻媴閻戞ê娈岄梺鎼炲€栭悧鐘荤嵁韫囨稒鏅搁柨鐕傛嫹
					 5'd 1:	begin oled_clk <= LOW; oled_dat <= char_reg[7]; end	//闂傚倸鍊搁崐鎼佸磹閹间礁纾归柣鎴ｅГ閸ゅ嫰鏌涢锝嗙５闁逞屽墾缁犳挸鐣锋總绋款潊闁炽儱鍟跨花銉╂⒒娴ｇ瓔娼愬鐟版閺呰泛螖閸涱厾锛涢柣搴秵閸犳鎮￠弴銏＄厓闁宠桨绀侀弳娆撴煙閼测晩鐒鹃棁澶嬬節婵犲倸鏆熺紒澶嬫そ閺岋紕浠﹂崜褋鈧帒霉閻欏懐鐣电€规洩缍佹俊鐤槾缂佺姵甯楃换婵嬫偨闂堟稐绮堕梺缁橆殔閿曨亪濡撮崘顔煎耿婵☆垰鐨烽弨铏節閻㈤潧孝婵炴潙鍊垮顐㈩吋閸℃ê寮垮┑顔筋殔濡顕ｉ妸褏妫い鎾寸☉娴滃墽绱撻崒姘偓鎼佸磹妞嬪海鐭嗗〒姘ｅ亾閽樻繂霉閸忓吋缍戠紒鐘卞嵆閺岀喖骞嗛悧鍫闂佽棄鍟伴崰鏍蓟瀹ュ鐓涘ù锝呮啞濞堝弶绻濆▓鍨仭闁瑰憡濞婂璇测槈濡攱鏂€闂佺硶鍓濋〃蹇斿瀹€鍕拺闁告繂瀚敍宥夋煕濞嗗繐鏆ｆ鐐插暙铻栭柛鎰ㄦ櫅閺嬪倿姊洪崨濠冨闁告挻宀稿畷鏇㈠箻缂佹ǚ鎷洪梺鑽ゅ枑濠㈡ê鈻撻埡鍛厵闁告垯鍊栫€氾拷
					 5'd 2:	begin oled_clk <= HIGH; end
					 5'd 3:	begin oled_clk <= LOW; oled_dat <= char_reg[6]; end
					 5'd 4:	begin oled_clk <= HIGH; end
					 5'd 5:	begin oled_clk <= LOW; oled_dat <= char_reg[5]; end
					 5'd 6:	begin oled_clk <= HIGH; end
					 5'd 7:	begin oled_clk <= LOW; oled_dat <= char_reg[4]; end
					 5'd 8:	begin oled_clk <= HIGH; end
					 5'd 9:	begin oled_clk <= LOW; oled_dat <= char_reg[3]; end
					 5'd10:	begin oled_clk <= HIGH; end
					 5'd11:	begin oled_clk <= LOW; oled_dat <= char_reg[2]; end
					 5'd12:	begin oled_clk <= HIGH; end
					 5'd13:	begin oled_clk <= LOW; oled_dat <= char_reg[1]; end
					 5'd14:	begin oled_clk <= HIGH; end
					 5'd15:	begin oled_clk <= LOW; oled_dat <= char_reg[0]; end	//闂傚倸鍊搁崐鎼佸磹閹间礁纾瑰瀣捣閻棗銆掑锝呬壕濡ょ姷鍋涢ˇ鐢稿极閹剧粯鍋愰柛鎰级閻ゅ嫰姊绘担铏瑰笡闁告棑绠撳畷婊堟晝閳ь剟鍩㈤幘缁樺殟闁靛绠戝鍨攽閻樼粯娑ф俊顐ｇ矒閿濈偤鏁冮埀顒勬箒濠电姴锕ら崯鎵矓濞差亝鐓涢悘鐐插⒔閵嗘帒霉閻欏懐鐣电€规洘绮忛ˇ顔尖攽椤斿吋澶勭紒缁樼箓閳绘捇宕归鍙ョ敾闂備胶鎳撻幉鈩冪箾婵犲洦鍋樻い鏇楀亾鐎殿喕绮欓、鏇㈡偄閾氬倸顥氭繝鐢靛仦閸ㄥ爼鎮烽鐐村€块柣锝呯灱绾惧ジ鏌ｅΟ璇插闁绘帞鏅槐鎺撴綇閵娿儳鐟查悗鍨緲鐎氼噣鍩€椤掑﹦绉甸柛瀣瀹曨剚寰勯幇顓涙嫼闂佸憡绻傜€氼剟藝椤掑嫭鐓曢柟鎯ь嚟缁犵偞顨ラ悙鑼鐎规洏鍔戝鍫曞箣濠婂懐鍊為梻鍌欑閹测€趁洪弽顓熷€舵慨姗嗗劮閹烘挸绶為柟閭﹀幘閸樹粙鏌熼崗鑲╂殬闁稿鍊曢…鍥箛閻楀牏鍘电紒鐐緲瀹曨剚绂嶉悧鍫闁绘劘灏欑粻濠氭煛娴ｈ宕岄柡浣规崌閺佹捇鏁撻敓锟�
					 5'd16:	begin oled_clk <= HIGH; end
					 5'd17:	begin oled_csn <= HIGH; state <= DELAY; end	//
					 default: state <= IDLE;
				endcase
				end
				DELAY://6
				begin	//闂傚倸鍊搁崐宄懊归崶顒夋晪鐟滃秹婀侀梺缁樺灱濡嫮澹曟繝姘叆婵犻潧妫Σ鍝ョ棯閹规劦娼愮紒缁樼洴楠炲鈻庤箛鏇氭偅闂備礁鎼€氥劑宕曢悽绋胯摕闁炽儱纾弳銈嗐亜閺傚灝鎮戞繝鈧导瀛樺€甸梻鍫熺〒閻掑憡鎱ㄦ繝鍛仩缂侇喗鐟ч幑鍕Ω瑜岀槐姗€姊绘担渚劸妞ゆ垵娲畷鎴﹀Χ閸涱垱娈鹃梺纭呮彧缁犳垹绮诲☉銏＄厽婵°倐鍋撻柣妤€绻樺畷銏°偅閸愨斁鎷洪梺鍛婄☉閿曪妇绱撳鑸电厱閹兼番鍨洪妵婵堚偓娈垮枟婵炲﹪銆佸☉銏″€烽悗鐢殿焾楠炲牓姊虹拠鎻掑毐缂傚秴妫濆畷鎴﹀川椤撶姵娈鹃悗鍏夊亾闁告洦鍓涢崢鍛婄箾鏉堝墽绉い顐㈩槸閻ｅ嘲鐣濋崟顒傚幐婵炶揪缍€椤鐣峰畝鍕厸濞达綀顫夊畷宀勬煛娴ｈ宕岄柡浣规崌閺佹捇鏁撻敓锟�
				if(cnt_delay >= num_delay) 
				    begin
					 cnt_delay <= 16'd0; 
					 state <= state_back; 
					 end 
				else 
				    cnt_delay <= cnt_delay + 1'b1;
				end
				default:state <= IDLE;
        endcase
		  end
  end
  
  


initial
    begin
	 time_head = "TIME:";
	 temp_head = "TEMP:";
	 cnt_main = 1'b0; 
	 cnt_init = 1'b0; 
	 cnt_scan = 1'b0; 
	 cnt_write = 1'b0;
	 y_p = 1'b0; 
	 x_ph = 1'b0; 
	 x_pl = 1'b0;
	 num = 1'b0; 
	 char = 1'b0; 
	 char_reg = 1'b0;
	 num_delay = 16'd5; 
	 cnt_delay = 1'b0; 
	 cnt = 1'b0;
	 oled_csn <= HIGH; 
	 oled_rst <= HIGH; 
	 oled_dcn <= CMD; 
	 oled_clk <= HIGH; 
	 oled_dat <= LOW;
	 state <= IDLE; 
	 state_back <= IDLE;
	 cmd[0 ] = {8'hae}; 
	 cmd[1 ] = {8'hd5}; 
	 cmd[2 ] = {8'h80}; 
	 cmd[3 ] = {8'ha8}; 
	 cmd[4 ] = {8'h3f}; 
	 cmd[5 ] = {8'hd3}; 
	 cmd[6 ] = {8'h00}; 
	 cmd[7 ] = {8'h40}; 
	 cmd[8 ] = {8'h8d}; 
	 cmd[9 ] = {8'h14}; 
	 cmd[10] = {8'h20}; 
	 cmd[11] = {8'h02};
	 cmd[12] = {8'hc8};
	 cmd[13] = {8'ha1};
	 cmd[14] = {8'hda};
	 cmd[15] = {8'h12};
	 cmd[16] = {8'h81};
	 cmd[17] = {8'hcf};
	 cmd[18] = {8'hd9};
	 cmd[19] = {8'hf1};
	 cmd[20] = {8'hdb};
	 cmd[21] = {8'h40};
	 cmd[22] = {8'haf};
	 cmd[23] = {8'h14};
	 cmd[24] = {8'haf};
	  
	 mem[  0] = {8'h3E, 8'h51, 8'h49, 8'h45, 8'h3E};   // 48  0
	 mem[  1] = {8'h00, 8'h42, 8'h7F, 8'h40, 8'h00};   // 49  1
	 mem[  2] = {8'h42, 8'h61, 8'h51, 8'h49, 8'h46};   // 50  2
	 mem[  3] = {8'h21, 8'h41, 8'h45, 8'h4B, 8'h31};   // 51  3
	 mem[  4] = {8'h18, 8'h14, 8'h12, 8'h7F, 8'h10};   // 52  4
	 mem[  5] = {8'h27, 8'h45, 8'h45, 8'h45, 8'h39};   // 53  5
	 mem[  6] = {8'h3C, 8'h4A, 8'h49, 8'h49, 8'h30};   // 54  6
	 mem[  7] = {8'h01, 8'h71, 8'h09, 8'h05, 8'h03};   // 55  7
	 mem[  8] = {8'h36, 8'h49, 8'h49, 8'h49, 8'h36};   // 56  8
	 mem[  9] = {8'h06, 8'h49, 8'h49, 8'h29, 8'h1E};   // 57  9
	 mem[ 10] = {8'h7C, 8'h12, 8'h11, 8'h12, 8'h7C};   // 65  A
	 mem[ 11] = {8'h7F, 8'h49, 8'h49, 8'h49, 8'h36};   // 66  B
	 mem[ 12] = {8'h3E, 8'h41, 8'h41, 8'h41, 8'h22};   // 67  C
	 mem[ 13] = {8'h7F, 8'h41, 8'h41, 8'h22, 8'h1C};   // 68  D
	 mem[ 14] = {8'h7F, 8'h49, 8'h49, 8'h49, 8'h41};   // 69  E
	 mem[ 15] = {8'h7F, 8'h09, 8'h09, 8'h09, 8'h01};   // 70  F

	 mem[ 32] = {8'h00, 8'h00, 8'h00, 8'h00, 8'h00};   // 32  sp 
	 mem[ 33] = {8'h00, 8'h00, 8'h2f, 8'h00, 8'h00};   // 33  !  
	 mem[ 34] = {8'h00, 8'h07, 8'h00, 8'h07, 8'h00};   // 34  
	 mem[ 35] = {8'h14, 8'h7f, 8'h14, 8'h7f, 8'h14};   // 35  #
	 mem[ 36] = {8'h24, 8'h2a, 8'h7f, 8'h2a, 8'h12};   // 36  $
	 mem[ 37] = {8'h62, 8'h64, 8'h08, 8'h13, 8'h23};   // 37  %
	 mem[ 38] = {8'h36, 8'h49, 8'h55, 8'h22, 8'h50};   // 38  &
	 mem[ 39] = {8'h00, 8'h05, 8'h03, 8'h00, 8'h00};   // 39  '
	 mem[ 40] = {8'h00, 8'h1c, 8'h22, 8'h41, 8'h00};   // 40  (
	 mem[ 41] = {8'h00, 8'h41, 8'h22, 8'h1c, 8'h00};   // 41  )
	 mem[ 42] = {8'h14, 8'h08, 8'h3E, 8'h08, 8'h14};   // 42  *
	 mem[ 43] = {8'h08, 8'h08, 8'h3E, 8'h08, 8'h08};   // 43  +
	 mem[ 44] = {8'h00, 8'h00, 8'hA0, 8'h60, 8'h00};   // 44  ,
	 mem[ 45] = {8'h08, 8'h08, 8'h08, 8'h08, 8'h08};   // 45  -
	 mem[ 46] = {8'h00, 8'h60, 8'h60, 8'h00, 8'h00};   // 46  .
	 mem[ 47] = {8'h20, 8'h10, 8'h08, 8'h04, 8'h02};   // 47  /
	 mem[ 48] = {8'h3E, 8'h51, 8'h49, 8'h45, 8'h3E};   // 48  0
	 mem[ 49] = {8'h00, 8'h42, 8'h7F, 8'h40, 8'h00};   // 49  1
	 mem[ 50] = {8'h42, 8'h61, 8'h51, 8'h49, 8'h46};   // 50  2
	 mem[ 51] = {8'h21, 8'h41, 8'h45, 8'h4B, 8'h31};   // 51  3
	 mem[ 52] = {8'h18, 8'h14, 8'h12, 8'h7F, 8'h10};   // 52  4
	 mem[ 53] = {8'h27, 8'h45, 8'h45, 8'h45, 8'h39};   // 53  5
	 mem[ 54] = {8'h3C, 8'h4A, 8'h49, 8'h49, 8'h30};   // 54  6
	 mem[ 55] = {8'h01, 8'h71, 8'h09, 8'h05, 8'h03};   // 55  7
	 mem[ 56] = {8'h36, 8'h49, 8'h49, 8'h49, 8'h36};   // 56  8
	 mem[ 57] = {8'h06, 8'h49, 8'h49, 8'h29, 8'h1E};   // 57  9
	 mem[ 58] = {8'h00, 8'h36, 8'h36, 8'h00, 8'h00};   // 58  :
	 mem[ 59] = {8'h00, 8'h56, 8'h36, 8'h00, 8'h00};   // 59  ;
	 mem[ 60] = {8'h08, 8'h14, 8'h22, 8'h41, 8'h00};   // 60  <
	 mem[ 61] = {8'h14, 8'h14, 8'h14, 8'h14, 8'h14};   // 61  =
	 mem[ 62] = {8'h00, 8'h41, 8'h22, 8'h14, 8'h08};   // 62  >
	 mem[ 63] = {8'h02, 8'h01, 8'h51, 8'h09, 8'h06};   // 63  ?
	 mem[ 64] = {8'h32, 8'h49, 8'h59, 8'h51, 8'h3E};   // 64  @
	 mem[ 65] = {8'h7C, 8'h12, 8'h11, 8'h12, 8'h7C};   // 65  A
	 mem[ 66] = {8'h7F, 8'h49, 8'h49, 8'h49, 8'h36};   // 66  B
	 mem[ 67] = {8'h3E, 8'h41, 8'h41, 8'h41, 8'h22};   // 67  C
	 mem[ 68] = {8'h7F, 8'h41, 8'h41, 8'h22, 8'h1C};   // 68  D
	 mem[ 69] = {8'h7F, 8'h49, 8'h49, 8'h49, 8'h41};   // 69  E
	 mem[ 70] = {8'h7F, 8'h09, 8'h09, 8'h09, 8'h01};   // 70  F
	 mem[ 71] = {8'h3E, 8'h41, 8'h49, 8'h49, 8'h7A};   // 71  G
	 mem[ 72] = {8'h7F, 8'h08, 8'h08, 8'h08, 8'h7F};   // 72  H
	 mem[ 73] = {8'h00, 8'h41, 8'h7F, 8'h41, 8'h00};   // 73  I
	 mem[ 74] = {8'h20, 8'h40, 8'h41, 8'h3F, 8'h01};   // 74  J
	 mem[ 75] = {8'h7F, 8'h08, 8'h14, 8'h22, 8'h41};   // 75  K
	 mem[ 76] = {8'h7F, 8'h40, 8'h40, 8'h40, 8'h40};   // 76  L
	 mem[ 77] = {8'h7F, 8'h02, 8'h0C, 8'h02, 8'h7F};   // 77  M
	 mem[ 78] = {8'h7F, 8'h04, 8'h08, 8'h10, 8'h7F};   // 78  N
	 mem[ 79] = {8'h3E, 8'h41, 8'h41, 8'h41, 8'h3E};   // 79  O
	 mem[ 80] = {8'h7F, 8'h09, 8'h09, 8'h09, 8'h06};   // 80  P
	 mem[ 81] = {8'h3E, 8'h41, 8'h51, 8'h21, 8'h5E};   // 81  Q
	 mem[ 82] = {8'h7F, 8'h09, 8'h19, 8'h29, 8'h46};   // 82  R
	 mem[ 83] = {8'h46, 8'h49, 8'h49, 8'h49, 8'h31};   // 83  S
	 mem[ 84] = {8'h01, 8'h01, 8'h7F, 8'h01, 8'h01};   // 84  T
	 mem[ 85] = {8'h3F, 8'h40, 8'h40, 8'h40, 8'h3F};   // 85  U
	 mem[ 86] = {8'h1F, 8'h20, 8'h40, 8'h20, 8'h1F};   // 86  V
	 mem[ 87] = {8'h3F, 8'h40, 8'h38, 8'h40, 8'h3F};   // 87  W
	 mem[ 88] = {8'h63, 8'h14, 8'h08, 8'h14, 8'h63};   // 88  X
	 mem[ 89] = {8'h07, 8'h08, 8'h70, 8'h08, 8'h07};   // 89  Y
	 mem[ 90] = {8'h61, 8'h51, 8'h49, 8'h45, 8'h43};   // 90  Z
	 mem[ 91] = {8'h00, 8'h7F, 8'h41, 8'h41, 8'h00};   // 91  [
	 mem[ 92] = {8'h55, 8'h2A, 8'h55, 8'h2A, 8'h55};   // 92  .
	 mem[ 93] = {8'h00, 8'h41, 8'h41, 8'h7F, 8'h00};   // 93  ]
	 mem[ 94] = {8'h04, 8'h02, 8'h01, 8'h02, 8'h04};   // 94  ^
	 mem[ 95] = {8'h40, 8'h40, 8'h40, 8'h40, 8'h40};   // 95  _
	 mem[ 96] = {8'h00, 8'h01, 8'h02, 8'h04, 8'h00};   // 96  '
	 mem[ 97] = {8'h20, 8'h54, 8'h54, 8'h54, 8'h78};   // 97  a
	 mem[ 98] = {8'h7F, 8'h48, 8'h44, 8'h44, 8'h38};   // 98  b
	 mem[ 99] = {8'h38, 8'h44, 8'h44, 8'h44, 8'h20};   // 99  c
	 mem[100] = {8'h38, 8'h44, 8'h44, 8'h48, 8'h7F};   // 100 d
	 mem[101] = {8'h38, 8'h54, 8'h54, 8'h54, 8'h18};   // 101 e
	 mem[102] = {8'h08, 8'h7E, 8'h09, 8'h01, 8'h02};   // 102 f
	 mem[103] = {8'h18, 8'hA4, 8'hA4, 8'hA4, 8'h7C};   // 103 g
	 mem[104] = {8'h7F, 8'h08, 8'h04, 8'h04, 8'h78};   // 104 h
	 mem[105] = {8'h00, 8'h44, 8'h7D, 8'h40, 8'h00};   // 105 i
	 mem[106] = {8'h40, 8'h80, 8'h84, 8'h7D, 8'h00};   // 106 j
	 mem[107] = {8'h7F, 8'h10, 8'h28, 8'h44, 8'h00};   // 107 k
	 mem[108] = {8'h00, 8'h41, 8'h7F, 8'h40, 8'h00};   // 108 l
	 mem[109] = {8'h7C, 8'h04, 8'h18, 8'h04, 8'h78};   // 109 m
	 mem[110] = {8'h7C, 8'h08, 8'h04, 8'h04, 8'h78};   // 110 n
	 mem[111] = {8'h38, 8'h44, 8'h44, 8'h44, 8'h38};   // 111 o
	 mem[112] = {8'hFC, 8'h24, 8'h24, 8'h24, 8'h18};   // 112 p
	 mem[113] = {8'h18, 8'h24, 8'h24, 8'h18, 8'hFC};   // 113 q
	 mem[114] = {8'h7C, 8'h08, 8'h04, 8'h04, 8'h08};   // 114 r
	 mem[115] = {8'h48, 8'h54, 8'h54, 8'h54, 8'h20};   // 115 s
	 mem[116] = {8'h04, 8'h3F, 8'h44, 8'h40, 8'h20};   // 116 t
	 mem[117] = {8'h3C, 8'h40, 8'h40, 8'h20, 8'h7C};   // 117 u
	 mem[118] = {8'h1C, 8'h20, 8'h40, 8'h20, 8'h1C};   // 118 v
	 mem[119] = {8'h3C, 8'h40, 8'h30, 8'h40, 8'h3C};   // 119 w
	 mem[120] = {8'h44, 8'h28, 8'h10, 8'h28, 8'h44};   // 120 x
	 mem[121] = {8'h1C, 8'hA0, 8'hA0, 8'hA0, 8'h7C};   // 121 y
	 mem[122] = {8'h44, 8'h64, 8'h54, 8'h4C, 8'h44};   // 122 z
	 mem[123] = {8'h00, 8'h00, 8'h00, 8'h03, 8'h03};   // 123 
	 
	 
	 
    mem_chinese[  0] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};//缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾剧懓顪冪€ｎ亝鎹ｉ柣顓炴閵嗘帒顫濋敐鍛闂備浇顕栭崹浼此囬幍顔剧处闁伙絽鐬奸惌娆撴偣娓氼垳鍘滅紒杈╂暬濮婄粯绗熼埀顒€顭囪閹囧幢濞存澘娲︾€靛ジ寮堕幋鐙呯幢闂佽鍑界紞鍡涘窗濡ゅ懏鍋傞柕澶嗘櫆閻撶喖鏌￠崶鈺佷粶闁逞屽墮濠€閬嶅焵椤掍胶鍟查柟鍑ゆ嫹
	
	
	mem_chinese[  1] = {8'h00,8'h20,8'h20,8'h20,8'h20,8'hFF,8'h00,8'h00};
	mem_chinese[  2] = {8'h00,8'hFF,8'h40,8'h20,8'h10,8'h08,8'h00,8'h00};
	mem_chinese[  3] = {8'h20,8'h60,8'h20,8'h10,8'h10,8'hFF,8'h00,8'h00};
	mem_chinese[  4] = {8'h00,8'h3F,8'h40,8'h40,8'h40,8'h40,8'h78,8'h00}; /*"北",0*/
	mem_chinese[  5] = {8'h04,8'h04,8'h04,8'hE4,8'h24,8'h24,8'h25,8'h26};
	mem_chinese[  6] = {8'h24,8'h24,8'h24,8'hE4,8'h04,8'h04,8'h04,8'h00};
	mem_chinese[  7] = {8'h00,8'h40,8'h20,8'h1B,8'h02,8'h42,8'h82,8'h7E};
	mem_chinese[  8] = {8'h02,8'h02,8'h02,8'h0B,8'h10,8'h60,8'h00,8'h00}; /*"京",1*/
	mem_chinese[  9] = {8'h04,8'h84,8'h84,8'hFC,8'h84,8'h84,8'h00,8'hFE};
	mem_chinese[ 10] = {8'h92,8'h92,8'hFE,8'h92,8'h92,8'hFE,8'h00,8'h00};
	mem_chinese[ 11] = {8'h20,8'h60,8'h20,8'h1F,8'h10,8'h10,8'h40,8'h44};
	mem_chinese[ 12] = {8'h44,8'h44,8'h7F,8'h44,8'h44,8'h44,8'h40,8'h00}; /*"理",2*/
	mem_chinese[ 13] = {8'h00,8'h04,8'h04,8'h04,8'h04,8'h04,8'h04,8'hFC};
	mem_chinese[ 14] = {8'h04,8'h04,8'h04,8'h04,8'h04,8'h04,8'h00,8'h00};
	mem_chinese[ 15] = {8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h3F};
	mem_chinese[ 16] = {8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h00}; /*"工",3*/
	mem_chinese[ 17] = {8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'hFF};
	mem_chinese[ 18] = {8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h20,8'h00};
	mem_chinese[ 19] = {8'h80,8'h80,8'h40,8'h20,8'h10,8'h0C,8'h03,8'h00};
	mem_chinese[ 20] = {8'h03,8'h0C,8'h10,8'h20,8'h40,8'h80,8'h80,8'h00}; /*"大",4*/
	mem_chinese[ 21] = {8'h40,8'h30,8'h11,8'h96,8'h90,8'h90,8'h91,8'h96};
	mem_chinese[ 22] = {8'h90,8'h90,8'h98,8'h14,8'h13,8'h50,8'h30,8'h00};
	mem_chinese[ 23] = {8'h04,8'h04,8'h04,8'h04,8'h04,8'h44,8'h84,8'h7E};
	mem_chinese[ 24] = {8'h06,8'h05,8'h04,8'h04,8'h04,8'h04,8'h04,8'h00}; /*"学",5*/
	mem_chinese[ 25] = {8'h00,8'h02,8'h02,8'hF2,8'h12,8'h12,8'h12,8'hF2};
	mem_chinese[ 26] = {8'h02,8'h02,8'h02,8'hFE,8'h02,8'h02,8'h02,8'h00};
	mem_chinese[ 27] = {8'h00,8'h00,8'h00,8'h0F,8'h04,8'h04,8'h04,8'h0F};
	mem_chinese[ 28] = {8'h00,8'h40,8'h80,8'h7F,8'h00,8'h00,8'h00,8'h00}; /*"闂傚倷绀侀幉锟犳偡闁秴绠柨鐕傛嫹",6*/
	mem_chinese[ 29] = {8'h10,8'h0C,8'h44,8'h44,8'h44,8'h44,8'h45,8'hC6};
	mem_chinese[ 30] = {8'h44,8'h44,8'h44,8'h44,8'h44,8'h14,8'h0C,8'h00};
	mem_chinese[ 31] = {8'h80,8'h40,8'h20,8'h1E,8'h20,8'h40,8'h40,8'h7F};
	mem_chinese[ 32] = {8'h44,8'h44,8'h44,8'h44,8'h44,8'h40,8'h40,8'h00}; /*"闂備浇顕уù宄扳枍閵忋倕绠柨鐕傛嫹",7*/
	mem_chinese[ 33] = {8'h00,8'hFC,8'h84,8'h84,8'h84,8'hFC,8'h00,8'h10};
	mem_chinese[ 34] = {8'h10,8'h10,8'h10,8'h10,8'hFF,8'h10,8'h10,8'h00};
	mem_chinese[ 35] = {8'h00,8'h3F,8'h10,8'h10,8'h10,8'h3F,8'h00,8'h00};
	mem_chinese[ 36] = {8'h01,8'h06,8'h40,8'h80,8'h7F,8'h00,8'h00,8'h00}; /*"闂傚倷绀侀幖顐﹀窗濞戙垹绠柨鐕傛嫹",8*/
	mem_chinese[ 37] = {8'h00,8'hF8,8'h0C,8'h0B,8'h08,8'h08,8'hF8,8'h40};
	mem_chinese[ 38] = {8'h30,8'h8F,8'h08,8'h08,8'h08,8'hF8,8'h00,8'h00};
	mem_chinese[ 39] = {8'h00,8'h7F,8'h21,8'h21,8'h21,8'h21,8'h7F,8'h00};
	mem_chinese[ 40] = {8'h00,8'h00,8'h43,8'h80,8'h40,8'h3F,8'h00,8'h00}; /*"闂傚倷鐒﹀鍧楁偂婢舵劕绠柨鐕傛嫹",9*/
	mem_chinese[ 41] = {8'h40,8'h40,8'h44,8'h44,8'h54,8'h64,8'h45,8'h46};
	mem_chinese[ 42] = {8'h44,8'h64,8'h54,8'h44,8'h44,8'h40,8'h40,8'h00};
	mem_chinese[ 43] = {8'h00,8'h00,8'h00,8'hFF,8'h49,8'h49,8'h49,8'h49};
	mem_chinese[ 44] = {8'h49,8'h49,8'h49,8'hFF,8'h00,8'h00,8'h00,8'h00}; /*"闂傚倸鍊搁崐鎼佲€﹂銏犵闁跨噦鎷�",10*/
	mem_chinese[ 45] = {8'h00,8'h00,8'hE0,8'h9C,8'h84,8'h84,8'h84,8'hF4};
	mem_chinese[ 46] = {8'h82,8'h82,8'h83,8'h82,8'h80,8'h80,8'h00,8'h00};
	mem_chinese[ 47] = {8'h00,8'h20,8'h10,8'h08,8'h06,8'h40,8'h80,8'h7F};
	mem_chinese[ 48] = {8'h00,8'h00,8'h02,8'h04,8'h08,8'h30,8'h00,8'h00}; /*"婵犵數鍋為崹璺何涢幋锕€绠柨鐕傛嫹",11*/
	mem_chinese[ 49] = {8'h00,8'hFC,8'h84,8'h84,8'h84,8'hFC,8'h00,8'h10};
	mem_chinese[ 50] = {8'h10,8'h10,8'h10,8'h10,8'hFF,8'h10,8'h10,8'h00};
	mem_chinese[ 51] = {8'h00,8'h3F,8'h10,8'h10,8'h10,8'h3F,8'h00,8'h00};
	mem_chinese[ 52] = {8'h01,8'h06,8'h40,8'h80,8'h7F,8'h00,8'h00,8'h00}; /*"闂傚倷绀侀幖顐﹀窗濞戙垹绠柨鐕傛嫹",12*/
	mem_chinese[ 53] = {8'h20,8'h10,8'h2C,8'hE7,8'h24,8'h24,8'h00,8'hF0};
	mem_chinese[ 54] = {8'h10,8'h10,8'hFF,8'h10,8'h10,8'hF0,8'h00,8'h00};
	mem_chinese[ 55] = {8'h01,8'h01,8'h01,8'h7F,8'h21,8'h11,8'h00,8'h07};
	mem_chinese[ 56] = {8'h02,8'h02,8'hFF,8'h02,8'h02,8'h07,8'h00,8'h00}; /*"闂傚倸鍊烽悞锕傚几婵犳艾绠柨鐕傛嫹",13*/
	
    mem_chinese[ 57] = {8'h00,8'h02,8'h82,8'h82,8'h82,8'h82,8'h82,8'hFE};/*"鐜�",0*/
    mem_chinese[ 58] = {8'h82,8'h82,8'h82,8'h82,8'h82,8'h02,8'h00,8'h00};/*"鐜�",0*/
    mem_chinese[ 59] = {8'h40,8'h40,8'h40,8'h40,8'h40,8'h40,8'h40,8'h7F};/*"鐜�",0*/
    mem_chinese[ 60] = {8'h40,8'h40,8'h40,8'h40,8'h40,8'h40,8'h40,8'h00};/*"鐜�",0*/
    mem_chinese[ 61] = {8'h00,8'h00,8'hFE,8'h92,8'h92,8'h92,8'h92,8'hFE};/*"鎬�",1*/
    mem_chinese[ 62] = {8'h92,8'h92,8'h92,8'h92,8'hFE,8'h00,8'h00,8'h00};/*"鎬�",1*/
    mem_chinese[ 63] = {8'h40,8'h38,8'h01,8'h00,8'h3C,8'h40,8'h40,8'h42};/*"鎬�",1*/
    mem_chinese[ 64] = {8'h4C,8'h40,8'h40,8'h70,8'h05,8'h08,8'h30,8'h00};/*"鎬�",1*/
    mem_chinese[ 65] = {8'h00,8'h80,8'h60,8'hF8,8'h07,8'h00,8'h1C,8'hE0};/*"浠�",2*/
    mem_chinese[ 66] = {8'h01,8'h06,8'h00,8'hE0,8'h1E,8'h00,8'h00,8'h00};/*"浠�",2*/
    mem_chinese[ 67] = {8'h01,8'h00,8'h00,8'hFF,8'h00,8'h80,8'h40,8'h20};/*"浠�",2*/
    mem_chinese[ 68] = {8'h13,8'h0C,8'h13,8'h20,8'h40,8'h80,8'h80,8'h00};/*"浠�",2*/
	
	mem_chinese[ 69] = {8'h04,8'h74,8'h54,8'h55,8'h56,8'h54,8'h74,8'h04};/*"郭",0*/
    mem_chinese[ 70] = {8'h00,8'hFE,8'h02,8'h22,8'hDA,8'h06,8'h00,8'h00};/*"郭",0*/
    mem_chinese[ 71] = {8'h10,8'h11,8'h51,8'h91,8'h7D,8'h0B,8'h09,8'h08};/*"郭",0*/
    mem_chinese[ 72] = {8'h00,8'hFF,8'h08,8'h10,8'h08,8'h07,8'h00,8'h00};/*"郭",0*/
    mem_chinese[ 73] = {8'h00,8'h04,8'h04,8'h74,8'h54,8'h54,8'h55,8'h56};/*"亮",1*/
    mem_chinese[ 74] = {8'h54,8'h54,8'h54,8'h74,8'h04,8'h04,8'h00,8'h00};/*"亮",1*/
    mem_chinese[ 75] = {8'h84,8'h83,8'h41,8'h21,8'h1D,8'h05,8'h05,8'h05};/*"亮",1*/
    mem_chinese[ 76] = {8'h05,8'h05,8'h7D,8'h81,8'h81,8'h85,8'hE3,8'h00};/*"亮",1*/
	
	
	mem_chinese[ 77] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 78] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 79] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 80] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 81] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 82] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 83] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[ 84] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};
	
    mem_chinese[ 85] = {8'h00,8'hE0,8'h10,8'h08,8'h08,8'h10,8'hE0,8'h00};//0
    mem_chinese[ 86] = {8'h00,8'h0F,8'h10,8'h20,8'h20,8'h10,8'h0F,8'h00};
    mem_chinese[ 87] = {8'h00,8'h00,8'h10,8'h10,8'hF8,8'h00,8'h00,8'h00};//1
    mem_chinese[ 88] = {8'h00,8'h00,8'h20,8'h20,8'h3F,8'h20,8'h20,8'h00};
    mem_chinese[ 89] = {8'h00,8'h70,8'h08,8'h08,8'h08,8'h08,8'hF0,8'h00};//2
    mem_chinese[ 90] = {8'h00,8'h30,8'h28,8'h24,8'h22,8'h21,8'h30,8'h00};
    mem_chinese[ 91] = {8'h00,8'h30,8'h08,8'h08,8'h08,8'h88,8'h70,8'h00};//3
    mem_chinese[ 92] = {8'h00,8'h18,8'h20,8'h21,8'h21,8'h22,8'h1C,8'h00};
    mem_chinese[ 93] = {8'h00,8'h00,8'h80,8'h40,8'h30,8'hF8,8'h00,8'h00};//4
    mem_chinese[ 94] = {8'h00,8'h06,8'h05,8'h24,8'h24,8'h3F,8'h24,8'h24};
    mem_chinese[ 95] = {8'h00,8'hF8,8'h88,8'h88,8'h88,8'h08,8'h08,8'h00};//5
    mem_chinese[ 96] = {8'h00,8'h19,8'h20,8'h20,8'h20,8'h11,8'h0E,8'h00};
    mem_chinese[ 97] = {8'h00,8'hE0,8'h10,8'h88,8'h88,8'h90,8'h00,8'h00};//6
    mem_chinese[ 98] = {8'h00,8'h0F,8'h11,8'h20,8'h20,8'h20,8'h1F,8'h00};
    mem_chinese[ 99] = {8'h00,8'h18,8'h08,8'h08,8'h88,8'h68,8'h18,8'h00};//7
    mem_chinese[100] = {8'h00,8'h00,8'h00,8'h3E,8'h01,8'h00,8'h00,8'h00};
    mem_chinese[101] = {8'h00,8'h70,8'h88,8'h08,8'h08,8'h88,8'h70,8'h00};//8
    mem_chinese[102] = {8'h00,8'h1C,8'h22,8'h21,8'h21,8'h22,8'h1C,8'h00};
    mem_chinese[103] = {8'h00,8'hF0,8'h08,8'h08,8'h08,8'h10,8'hE0,8'h00};//9
    mem_chinese[104] = {8'h00,8'h01,8'h12,8'h22,8'h22,8'h11,8'h0F,8'h00};
	mem_chinese[105] = {8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00};//.
	mem_chinese[106] = {8'h00,8'h30,8'h30,8'h00,8'h00,8'h00,8'h00,8'h00};
	mem_chinese[107] = {8'h00, 8'h40, 8'h42, 8'h44, 8'h58, 8'h40, 8'h40, 8'h7F}; // 閻熸粌搴滈幏锟�
	mem_chinese[108] = {8'h40, 8'h40, 8'h50, 8'h48, 8'hC6, 8'h00, 8'h00, 8'h00}; 
	mem_chinese[109] = {8'h00, 8'h40, 8'h44, 8'h44, 8'h44, 8'h44, 8'h44, 8'h44}; 
	mem_chinese[110] = {8'h44, 8'h44, 8'h44, 8'hFF, 8'h00, 8'h00, 8'h00, 8'h00};
	mem_chinese[111] = {8'h08, 8'h08, 8'hE8, 8'h29, 8'h2E, 8'h28, 8'hE8, 8'h08}; // 闂佸憡鎼幏锟�
	mem_chinese[112] = {8'h08, 8'hC8, 8'h0C, 8'h0B, 8'hE8, 8'h08, 8'h08, 8'h00};
	mem_chinese[113] = {8'h00, 8'h00, 8'hFF, 8'h09, 8'h49, 8'h89, 8'h7F, 8'h00}; 
	mem_chinese[114] = {8'h00, 8'h0F, 8'h40, 8'h80, 8'h7F, 8'h00, 8'h00, 8'h00};
	mem_chinese[115] = {8'h00, 8'hFC, 8'h84, 8'h84, 8'h84, 8'hFC, 8'h00, 8'h10}; // 闂佸搫鍠涢幏锟� 
	mem_chinese[116] = {8'h10, 8'h10, 8'h10, 8'hFF, 8'h10, 8'h10, 8'h00, 8'h00};
	mem_chinese[117] = {8'h00, 8'h3F, 8'h10, 8'h10, 8'h10, 8'h3F, 8'h00, 8'h00}; 
	mem_chinese[118] = {8'h01, 8'h06, 8'h40, 8'h80, 8'h7F, 8'h00, 8'h00, 8'h00};
	mem_chinese[119] = {8'h00, 8'hF8, 8'h01, 8'h06, 8'h00, 8'hF0, 8'h12, 8'h12}; // 闂傚倸鍋婇幏锟� 
	mem_chinese[120] = {8'h12, 8'hF2, 8'h02, 8'h02, 8'h02, 8'hFE, 8'h00, 8'h00};
	mem_chinese[121] = {8'h00, 8'hFF, 8'h00, 8'h00, 8'h00, 8'h1F, 8'h11, 8'h11}; 
	mem_chinese[122] = {8'h11, 8'h1F, 8'h00, 8'h40, 8'h80, 8'h7F, 8'h00, 8'h00};
	mem_chinese[123] = {8'h00,8'hF8,8'h01,8'h22,8'h20,8'h22,8'h2A,8'hF2};
	mem_chinese[124] = {8'h22,8'h22,8'h22,8'h22,8'h02,8'hFE,8'h00,8'h00};
	mem_chinese[125] = {8'h00,8'hFF,8'h00,8'h00,8'h1F,8'h01,8'h01,8'h7F};
	mem_chinese[126] = {8'h09,8'h11,8'h0F,8'h40,8'h80,8'h7F,8'h00,8'h00}; /*"闂傚倸鍋婇幏锟�",0*/
	mem_chinese[127] = {8'h20,8'h10,8'h2C,8'hE7,8'h24,8'h24,8'h00,8'hF0};
	mem_chinese[128] = {8'h10,8'h10,8'hFF,8'h10,8'h10,8'hF0,8'h00,8'h00};
	mem_chinese[129] = {8'h01,8'h01,8'h01,8'h7F,8'h21,8'h11,8'h00,8'h07};
	mem_chinese[130] = {8'h02,8'h02,8'hFF,8'h02,8'h02,8'h07,8'h00,8'h00}; /*"闂備焦鏋婚幏锟�",1*/

	mem_chinese[131] = {8'h00, 8'hFC, 8'h84, 8'h84, 8'h84, 8'hFC, 8'h00, 8'h10}; // 闂佸搫鍠涢幏锟�
	mem_chinese[132] = {8'h10, 8'h10, 8'h10, 8'hFF, 8'h10, 8'h10, 8'h00, 8'h00}; 
	mem_chinese[133] = {8'h00, 8'h3F, 8'h10, 8'h10, 8'h10, 8'h3F, 8'h00, 8'h00}; 
	mem_chinese[134] = {8'h01, 8'h06, 8'h40, 8'h80, 8'h7F, 8'h00, 8'h00, 8'h00}; 
	mem_chinese[135] = {8'h80, 8'h40, 8'h20, 8'h90, 8'h88, 8'h86, 8'h80, 8'h80}; // 闂佸憡甯幏锟�
	mem_chinese[136] = {8'h80, 8'h83, 8'h8C, 8'h10, 8'h20, 8'h40, 8'h80, 8'h00}; 
	mem_chinese[137] = {8'h00, 8'h80, 8'h40, 8'h20, 8'h18, 8'h07, 8'h00, 8'h40}; 
	mem_chinese[138] = {8'h80, 8'h40, 8'h3F, 8'h00, 8'h00, 8'h00, 8'h00, 8'h00}; 
	mem_chinese[139] = {8'h24, 8'h24, 8'hA4, 8'hFE, 8'h23, 8'h22, 8'h00, 8'hC0}; // 缂備礁顧€閹凤拷
	mem_chinese[140] = {8'h38, 8'h00, 8'hFF, 8'h00, 8'h08, 8'h10, 8'h60, 8'h00}; 
	mem_chinese[141] = {8'h08, 8'h06, 8'h01, 8'hFF, 8'h01, 8'h06, 8'h81, 8'h80}; 
	mem_chinese[142] = {8'h40, 8'h40, 8'h27, 8'h10, 8'h0C, 8'h03, 8'h00, 8'h00}; 


	 end
	 
	 
  
always@(posedge clk or negedge rst)//闂佺鐭囬崘銊у幀闂傚倸锕ら崢鏍不娴煎瓨鍋╃€光偓閸曨剚銆冮梺姹囧灮閸犳劙宕瑰璺烘闁搞儜鍛喕
    begin
        if(!rst) begin
            choice[0] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[1] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 7) begin
            choice[0] = 128'h0000_0102_0506_090a_0d0e_1112_1516_0000;
            choice[1] = 128'h0000_0304_0708_0b0c_0f10_1314_1718_0000;
            choice[2] = 128'h191a_1d1e_2122_2526_292a_2d2e_3132_3536;
            choice[3] = 128'h1b1c_1f20_2324_2728_2b2c_2f30_3334_3738;
            choice[4] = 128'h004546_0000_494a_0000_393a_3d3e_414200;
            choice[5] = 128'h000748_0000_4b4c_0000_3b3c_3f40_434400;
            choice[6] = 128'h0000_0057_5759_5559_575b_5765_5d00_0000;
            choice[7] = 128'h0000_0058_585a_565a_585c_5866_5e00_0000;end
        else if(oled_mode == 0)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_0000;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_0000;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 1)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_8384;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_8586;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 2)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_8788;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_898a;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 3)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_8b8c;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_8d8e;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 4)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_0000;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_0000;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_8384;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_8586;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 5)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_0000;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_0000;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_8788;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_898a;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
        else if(oled_mode == 6)begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_0000;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_0000;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_8b8c;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_8d8e;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
		else begin
            choice[0] = 128'h0000_0000_6b6c_6f70_7374_7778_0000_0000;
            choice[1] = 128'h0000_0000_6d6e_7172_7576_797a_0000_0000;
			choice[2] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[3] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[4] = 128'h0000_0000_0000_7b7c_7f80_0000_0000_0000;
            choice[5] = 128'h0000_0000_0000_7d7e_8182_0000_0000_0000;
            choice[6] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;
            choice[7] = 128'h0000_0000_0000_0000_0000_0000_0000_0000;end
    end
  

endmodule